<!DOCTYPE html>
<html>

<head>
  <title>02-float+fix+float</title>
  <style type="text/css">
    .container {
      position: relative;
    }

    .left {
      float: left;
      width: 100px;

      background-color: green;
      height: 100px;
    }

    .middle {
      margin: 0 100px;

      background-color: red;
      height: 300px;
    }

    .right {
      float: right;
      width: 100px;

      background-color: blue;
      height: 150px;
    }
  </style>
</head>

<body style="margin:0;">
  <div class="container">
    <!-- 浮动元素必须在前 -->
    <div class="left">I am left</div>
    <div class="right">I am right</div>
    <div class="middle">I am middle</div>
  </div>
  <div style="height: 100px; background-color: yellow;"></div>
</body>

</html>